<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tld/authority.tld" prefix="authority" %>
<%@ taglib uri="/tld/token.tld" prefix="token" %>

<div class="pop-background">
    <style>
        .col-md-4 {
            max-width: 900px;
        }
    </style>
    <div class="col-md-4">
        <div class="popup panel-alt x-4-move">
            <div class="panel-heading">
                <div class="panel-btns">
                    <a class="panel-close btn-4-hide">×</a>
                </div>
                <h3 class="panel-title">系统角色：（${role.name}）权限管理</h3>
            </div>

            <div class="tab-content">
                <div class="panel-tab panel-default">
                    <div class="row ">
                        <input type="hidden" name="id" value="${role.id}">
                        <form>
                            <token:token/>
                            <div class="panel-body panel-body-h" style="padding-top:0">
                                <table class="table dataTable dataTable-label">
                                    <tbody>
                                    <c:forEach items="${sourceGroupList}" var="item">
                                        <c:choose>
                                            <c:when test="${item.virtual}">
                                                <tr class="Px-data bj-green-lit">
                                                    <td><a><i class="icon icon-shousuo btn-4-shrink"></i></a></td>
                                                    <td><input class="cursor-pointer"
                                                               type="checkbox" ${item.checked ? 'checked' : ''}></td>
                                                    <td colspan="2"><strong>${item.parentModule}</strong></td>
                                                </tr>
                                            </c:when>
                                            <c:otherwise>
                                                <tr class="x-data">
                                                    <td></td>
                                                    <td></td>
                                                    <td style="min-width: 95px"><input class="cursor-pointer"
                                                                                       type="checkbox" ${item.checked ? 'checked' : ''}>${item.childModule}
                                                    </td>
                                                    <td>
                                                        <c:forEach items="${item.sourceList}" var="i">
                                                            <em>
                                                                <input class="cursor-pointer"
                                                                       type="checkbox" ${i.checked ? 'checked' : ''}
                                                                       name="sourceId" value="${i.id}">${i.name}
                                                            </em>
                                                        </c:forEach>
                                                    </td>
                                                </tr>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </form>
                    </div>
                    <div class="btn-group2-s">
                        <div class="panel-body panel-body2">
                            <div class="btn-group2 left ">
                                <%--<authority:authority url="/role/modifySource">--%>
                                    <button class="btn btn-primary btn-4-save">保存</button>
                                <%--</authority:authority>--%>
                                <button class="btn btn-default btn-4-hide">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="js/system/role-source.js" charset="UTF-8"></script>
</div>